<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class MY_Model extends CI_Model
{
    protected $zend_db;
    function __construct()
    {
        parent::__construct();
        
        $this->zend->load('Zend/Db');
        
        $pdoParams = array(
            PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
        );
        
        $aDbConfig['host'] = $this->db->hostname;
        $aDbConfig['dbname'] = $this->db->database;
        $aDbConfig['username'] = $this->db->username;
        $aDbConfig['password'] = $this->db->password;
        $aDbConfig['driver_options'] = $pdoParams;
        $this->zend_db = $db = Zend_Db::factory('Pdo_Mysql', $aDbConfig );
    }
}